
import 'package:file_transfer/widget/app_bar_widget.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';

class AboutPage extends StatefulWidget {
  const AboutPage({super.key});

  @override
  State<AboutPage> createState() => _AboutPageState();
}

class _AboutPageState extends State<AboutPage> {
  String _version = "";
  _getVersion() async{
    final info = await PackageInfo.fromPlatform();
    setState(() {
      _version = info.version;
    });
  }

  @override
  Widget build(BuildContext context){
    _getVersion();
    return Scaffold(
      appBar: pageAppBar("关于软件", context),
      body: Container(
        alignment: Alignment.center,
        child: Column(
          children: [
            Expanded(
              child: Column(
                children: [
                  const SizedBox(height: 50),
                  Image.asset("assets/logo.png",width: 150,height: 150,),
                  Text("V $_version"),
                  const SizedBox(height: 20),
                  Text("确保设备处在同一局域网中使用")
                ],
              ),
            ),
            const Text("2025 © Reach - file.suxii.cn",style: TextStyle(
              color: Color(0xffd4d4d4),
              fontWeight: FontWeight.bold
            ),),
            const SizedBox(height: 20)
          ],
        ),
      ),
    );
  }
}

